package com.archstoday.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.archstoday.R;

import de.hdodenhof.circleimageview.CircleImageView;

/**
 * 用户发帖记录列表适配器
 */
public class UserSendAdapter extends BaseAdapter {

    private Context mContext;

    public UserSendAdapter(Context context) {
        mContext = context;
    }

    @Override
    public int getCount() {
        return 5;
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        Holder holder;
        if (view == null) {
            holder = new Holder();
            view = LayoutInflater.from(mContext).inflate(R.layout.item_user_send, null);
            holder.headIcon = (CircleImageView) view.findViewById(R.id.item_user_icon);
            holder.nameTv = (TextView) view.findViewById(R.id.item_user_name_tv);
            holder.titleTv = (TextView) view.findViewById(R.id.item_title_tv);
            holder.contentTv = (TextView) view.findViewById(R.id.item_content_tv);
            holder.img = (ImageView) view.findViewById(R.id.item_img);

            view.setTag(holder);
        } else {
            holder = (Holder) view.getTag();
        }

        holder.nameTv.setText("用户名");
        holder.titleTv.setText("用户发布帖子标题");
        holder.contentTv.setText("用户发布帖子的内容描述");

        return view;
    }

    class Holder {
        CircleImageView headIcon;
        TextView nameTv, titleTv, contentTv;
        ImageView img;
    }
}